<?php

namespace App\Providers;

use App\Http\ViewComposers\ProfileComposer;
use Carbon\Carbon;
use Illuminate\Support\ServiceProvider;
use View;

class ViewComposerServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
        //

        $age = Carbon::createFromDate(1993, 2, 2)->age;

        View::share('name', 'value');
        View::share('age', $age);
//        View::composer('admin.posts.index', function ($view) {
//
//        });
//        View::composer('*', function ($view) {
//            return $view->with('auth', \Auth::user());
//        });
//        View::composer('*','App\Http\ViewComposers\ProfileComposer');
//        View::composer('*', ProfileComposer::class);
//        View::composer(['pages.profile','pages.setting'], ProfileComposer::class);
//        View::creator(['pages.profile','pages.setting'], ProfileComposer::class);
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}
